# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks
maintainer="team/kde <bribbers@disroot.org>"
pkgname=kcalendarcore
pkgver=6.7.0
pkgrel=0
pkgdesc="The KDE calendar access library"
arch="all !armhf" # armhf blocked by extra-cmake-modules
url="https://community.kde.org/Frameworks"
license="LGPL-2.0-or-later"
depends_dev="libical-dev"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	graphviz
	qt6-qtbase-dev
	qt6-qttools-dev
	samurai
	"
checkdepends="
	perl
	xcb-util-cursor
	xvfb-run
	"
subpackages="$pkgname-dev $pkgname-doc"
_repo_url="https://invent.kde.org/frameworks/kcalendarcore.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kcalendarcore-$pkgver.tar.xz"

replaces="kcalcore"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_TESTING=ON \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure -E "test(dateserialization|memorycalendar|startdatetimesfordate|timesininterval|occurrenceiterator)"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
eefd19b1d88e901dc3ed4d917b87dfea3b80716ce0c8f9aa5d1a22246ad67c09e9365767484cf59522a6df00d8226f1520a18ac4be3c6cc2d95ef533cf0648c6  kcalendarcore-6.7.0.tar.xz
"
